<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div class="one">
        父标签
        <button>删除</button>
    </div>

        <script>
            //创建标签
            let div = document.createElement('div');
            div.innerHTML = '新创建的标签2';
            div.id = 'id';
            div.className = 'one';
            div.style.fontSize = '100px';
            console.log(div);

            //把标签到DOM树上
            let one = document.querySelector('.one');
            one.appendChild(div);
            
            
            //删除标签
            let button = document.querySelector('button');
            button.onclick = function() {
                one.removeChild(div);
            }
        </script>
</body>
</html>